//
//  WQIntelligenceFunctionCell.m
//  WisdomQuestor
//
//  Created by 纪景城 on 2024/12/18.
//

#import "WQIntelligenceFunctionCell.h"

@implementation WQIntelligenceFunctionCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.clipsToBounds = YES;
        self.backgroundColor = UIColor.clearColor;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self.contentView addSubviews:[NSArray arrayWithObjects:self.whiteCorView, nil]];
        [self.whiteCorView addSubviews:[NSArray arrayWithObjects:self.funImageView, self.funTitleLabel, self.funDescLabel, self.nextImageView, nil]];
        [self fragmentUI_ViewSet];
    }
    return self;
}

#pragma mark ------- Lazy Methods -------

- (void)fragmentUI_ViewSet {
    [self.whiteCorView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.equalTo(self.contentView);
        make.left.equalTo(self.contentView.mas_left).offset(kFragmemtFloat(12));
        make.right.equalTo(self.contentView.mas_right).offset(-kFragmemtFloat(12));
    }];
    [self.funImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.whiteCorView);
        make.left.equalTo(self.whiteCorView.mas_left).offset(kFragmemtFloat(21));
        make.size.mas_equalTo(kSizzleKapadate(26, 26));
    }];
    [self.funTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.funImageView.mas_right).offset(kFragmemtFloat(24));
        make.right.equalTo(self.whiteCorView.mas_right).offset(-kFragmemtFloat(50));
        make.bottom.equalTo(self.whiteCorView.mas_centerY).offset(-kFragmemtFloat(3.5));
    }];
    [self.funDescLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(self.funTitleLabel);
        make.top.equalTo(self.whiteCorView.mas_centerY).offset(kFragmemtFloat(3.5));
    }];
    [self.nextImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.whiteCorView);
        make.right.equalTo(self.whiteCorView.mas_right).offset(-kFragmemtFloat(16));
        make.size.mas_equalTo(kSizzleKapadate(5, 9));
    }];
}

- (UIView *)whiteCorView {
    if (!_whiteCorView) {
        _whiteCorView = [[UIView alloc] init];
        _whiteCorView.backgroundColor = UIColor.whiteColor;
        _whiteCorView.cornerRadius = kFragmemtFloat(10);
    }
    return _whiteCorView;
}

- (UIImageView *)funImageView {
    if (!_funImageView) {
        _funImageView = [[UIImageView alloc] initWithImage:kImageName(@"intelligence_guard_ico")];
    }
    return _funImageView;
}

- (UILabel *)funTitleLabel {
    if (!_funTitleLabel) {
        _funTitleLabel = [UILabel initWithTextColor:k_Color_222222 weight:UIFontWeightMedium size:16];
    }
    return _funTitleLabel;
}

- (UILabel *)funDescLabel {
    if (!_funDescLabel) {
        _funDescLabel = [UILabel initWithTextColor:k_Color_848484 weight:UIFontWeightMedium size:12];
    }
    return _funDescLabel;
}

- (UIImageView *)nextImageView {
    if (!_nextImageView) {
        _nextImageView = [[UIImageView alloc] initWithImage:kImageName(@"base_jiantousmall_huise")];
    }
    return _nextImageView;
}

@end
